import { createBrowserRouter, Navigate } from "react-router-dom";
import Ho from "../component/Ho";

import App from "../App"

// 登录验证
let AuthComponent = (props) => {
    let Com = props.children.type;
    if (sessionStorage.getItem("token")) {
        return <Com></Com>
    } else {
        return <Navigate to="/login"></Navigate>
    }
}

const router = createBrowserRouter([
   
    {
        path: "/",
        element: <Ho></Ho>
    },
    {
        path: "/",
        element: <Navigate to="/home"></Navigate>
    }
])

export default router